using System;

namespace HappyTemplate
{
	public class SourceLocation
	{
		public readonly int LineNo;
		public readonly int ColumnNo;
		public readonly string FileName;
		public SourceLocation(int line, int column, string file)
		{
			this.LineNo = line;
			this.ColumnNo = column;
			this.FileName = file;
		}

		public override string ToString()
		{
			return String.Format("{0} ({1},{2})", this.FileName, this.LineNo, this.ColumnNo);
		}

		private static SourceLocation _external;
		public static SourceLocation External
		{
			get { 
				if(_external == null)
					_external = new SourceLocation(1, 1, "external assembly");

				return _external;
			}
		}
	}
}
